package com.snail.starter.db.id;

import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;

/**
*
* @author: snail framework
* @Date: 2023/2/23 下午4:58
* @Version: 1.0.0
*/
public class CustomIdGenerator implements IdentifierGenerator {

    @Override
    public Number nextId(Object entity) {
        return IdUtil.getSnowflake(RandomUtil.randomInt(1, 10)).nextId();
    }

}
